Closed-loop stimulation strategy